


/**
 * 单例使用方法
 * 1. 继承Singleton类
 * 2. 重写GetInstance方法
 * 3. 调用GetInstance方法获取实例
 * exa
 * ```ts
 * export class AudioManager extends Singleton {
    static get instance() {
        return super.GetInstance<AudioManager>();
    }
}
 * ```
 */
export default class Singleton {
    private static _instance: any = null;
    static GetInstance<T>(): T {
        if (this._instance == null) {
            this._instance = new this();
        }
        return this._instance;
    }
}





